﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.IO;

namespace IronCommander.ViewModels
{
    public class DriveViewModel
    {
        public string DriveName { get; set; }
        public string Label { get; set; }
        public long TotalSpace { get; set; }
        public long FreeSpace { get; set; }

        public static DriveViewModel Create(DriveInfo drive)
        {
            var viewModel = new DriveViewModel { DriveName = drive.Name };

            if (drive.IsReady)
            {
                viewModel.Label = drive.VolumeLabel;
                viewModel.FreeSpace = drive.AvailableFreeSpace;
                viewModel.TotalSpace = drive.TotalSize;
            }

            return viewModel;
        }
    }
}
